#pragma hdrstop
#include "TSchalter.h"
#pragma package(smart_init)
__fastcall TSchalter::TSchalter(TComponent* owner){
	TOWPinEvent pEvent = &(this->pinEvent);
	//* Initialisierung des outputpins
	this->outputPin = new TOWBoolSourcePin((TComponent*) owner, pEvent);
	//* outputpin auf 0 setzen
	this->outputPin->Value = 0;
}

TOWBasicPin* __fastcall TSchalter::getPin(Pin pin){
	TOWBasicPin* ret;

	switch (pin) {
		case OUTPUT_PIN_SCHALTER: //InputPin 1
			ret = this->outputPin;
			break;
		default:
			ret = NULL;
	}

	return (ret);
}

void __fastcall TSchalter::setState(bool state){
	this->outputPin->Value = state;
}

bool __fastcall TSchalter::connect(Pin pin, TOWBasicPin* pinToConnectTo){

	return this->outputPin->Connect(pinToConnectTo);
}

void __fastcall TSchalter::disconnect(Pin pin){
	this->outputPin->Disconnect();
}

void __fastcall TSchalter::pinEvent(TOWBasicPin* pin){

}
__fastcall TSchalter::~TSchalter(){

}


